package cn.qu.phizline.event.init;

import cn.qu.phizline.event.Body;
import cn.qu.phizline.event.Payload;

/**
 * 初始化  代码1
 */
public class InitEvent extends Payload {

    private static final int TYPE = 1;
    private static final int VERSION = 1;

    @Override
    public int getType() {
        return TYPE;
    }

    @Override
    public int getVersion() {
        return VERSION;
    }

    @Override
    public Class<InitBody> getBodyType() {
        return InitBody.class;
    }

    public static class InitBody implements Body {
        private String deviceId;
        private String token;

        public String getDeviceId() {
            return deviceId;
        }

        public void setDeviceId(String deviceId) {
            this.deviceId = deviceId;
        }

        public String getToken() {
            return token;
        }

        public void setToken(String token) {
            this.token = token;
        }
    }

    /**
     * 初始化成功,且Token和DeviceId验证有效,当Token有效时将刷新失效时间。
     */
    public static final int CODE_SUCCESS = 1000;
    /**
     * 初始化失败,且Token和DeviceId验证无效,需要重新登录。
     */
    public static final int CODE_FAILURE = 1001;

}
